' ***^^^***|||***^^^***
' 
'  This file is regenerated until it's edited. Delete the file to force regeneration.

'  NOTE: This denotes the way the file was created and it's possible the 
'        generation type has since changed.
'        Check the generation script for the curent state of the file.

' %%%###%%%09e4011ce763a947e0bceb3f6c25b322%%%###%%%
' %%%##NoWS##%%%408d3a381ce4ba8602dc9a2d7198f77f%%%##NoWS##%%%
' ***^^^***|||***^^^***

  
'************************************************************************************
' Copyright © 2003-2006 Kathleen Dollard
'
' This software is provided 'as-is', without any express or implied warranty. In no 
' event will the author be held liable for any damages arising from the use of this
' software.
' 
' You may use this software for any purpose, including commercial applications, 
' and you may redistribute this software as part of application delivery: however, 
' this copyright notice may not be removed and you may not otherwise redistribute 
' this software directly other than providing a link to wwww.gendotnet.com. 
'
' You may alter this software to better server your needs (I'd like to hear about your 
' changes in order to make the software better). If you alter the softwre, you must  
' clearly mark it as altered and must not be misrepresented as the original software.
' nor wholly your original work.
'*************************************************************************************

Option Explicit On
Option Strict On

Imports System
Imports System.Collections.Generic



Public Class Gen
	Inherits genGen

   Protected Overrides Function ShouldOutputObjectProperty( _
            ByVal propertyName As String, _
            ByVal GenObject As MetadataWrapper.GenObject) _
            As Boolean
      Select Case propertyName.ToLower
         Case "hasselfjoin"
            Return GenObject.HasSelfJoin.GetValueOrDefault()
         Case "tablenamecolumnname"
            Return (GenObject.IsMultiParentChild.GetValueOrDefault())
         Case "primarykeycolumnname"
            Return (GenObject.IsMultiParentChild.GetValueOrDefault())
         Case "IsMultiParentChild"
            Return (GenObject.IsMultiParentChild.GetValueOrDefault())
         Case Else
            Return MyBase.ShouldOutputObjectProperty(propertyName, GenObject)
      End Select
   End Function

   Protected Overrides Function ShouldOutputPropertyProperty( _
            ByVal propertyName As String, _
            ByVal GenProperty As MetadataWrapper.GenProperty) _
            As Boolean
      Dim ret As Nullable(Of Boolean) = CommonChecks.StandardColumnChecks(propertyName, GenProperty.NETType)
      If ret.HasValue Then
         Return ret.Value
      Else
         Return MyBase.ShouldOutputPropertyProperty(propertyName, GenProperty)
      End If
   End Function

   Protected Overrides Function ShouldOutputFilterCriteriaProperty( _
            ByVal propertyName As String, _
            ByVal GenFilterCriteria As MetadataWrapper.GenFilterCriteria) _
            As Boolean
      Select Case propertyName.ToLower()
         Case "name"
            Return (Not (String.IsNullOrEmpty(GenFilterCriteria.Name) Or GenFilterCriteria.Name.ToLower = "primarykey"))
      End Select
      Return MyBase.ShouldOutputFilterCriteriaProperty(propertyName, GenFilterCriteria)
   End Function

   Protected Overrides Function ShouldOutputForeignKeyTableChild(Of T)( _
            ByVal childName As String, ByVal child As T, _
            ByVal GenForeignKeyTable As MetadataWrapper.GenForeignKeyTable) _
            As Boolean
      If String.Compare(childName, "ExtraColumns", True) = 0 Then
         Return GenForeignKeyTable.GenExtraColumns.Count > 0
      End If
      Return MyBase.ShouldOutputForeignKeyTableChild(Of T)(childName, child, GenForeignKeyTable)
   End Function
End Class

Public Class GenCollection
	Inherits genGenCollection

End Class 

	